// Copyright (c) 2022 Erwin Kok. BSD-3-Clause license. See LICENSE file for more details.
package com.gitee.wsl.transform.encode.base

import kotlin.random.Random
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals


class Base10Test {
    @Test
    fun `round trip`() {
        var data = ByteArray(256)
        for (i in 0..512) {
            data = Random.nextBytes(data)
            val encoded = Base10.encode(data)
            val decoded = Base10.decode(encoded).getOrThrow()
            assertContentEquals(data, decoded)
        }
    }

//    @Test
//    fun empty() {
//        assertErrorResult("can not decode zero-length string") { Base10.decode("") }
//    }
//
//    @Test
//    fun `invalid character`() {
//        assertErrorResult("InvalidCharacter in base 10") { Base10.decode("sfjklgh") }
//    }
}
